/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Donnees;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author mizho
 */
@Entity
@Table(name = "thematique")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Thematique.findAll", query = "SELECT t FROM Thematique t"),
    @NamedQuery(name = "Thematique.findByIdthematique", query = "SELECT t FROM Thematique t WHERE t.idthematique = :idthematique"),
    @NamedQuery(name = "Thematique.findByNomthematique", query = "SELECT t FROM Thematique t WHERE t.nomthematique = :nomthematique")})
public class Thematique implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "idthematique")
    private String idthematique;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "nomthematique")
    private String nomthematique;
    @OneToMany(mappedBy = "thematique")
    private Collection<Ue> ueCollection;

    public Thematique() {
    }

    public Thematique(String idthematique) {
        this.idthematique = idthematique;
    }

    public Thematique(String idthematique, String nomthematique) {
        this.idthematique = idthematique;
        this.nomthematique = nomthematique;
    }

    public String getIdthematique() {
        return idthematique;
    }

    public void setIdthematique(String idthematique) {
        this.idthematique = idthematique;
    }

    public String getNomthematique() {
        return nomthematique;
    }

    public void setNomthematique(String nomthematique) {
        this.nomthematique = nomthematique;
    }

    @XmlTransient
    public Collection<Ue> getUeCollection() {
        return ueCollection;
    }

    public void setUeCollection(Collection<Ue> ueCollection) {
        this.ueCollection = ueCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idthematique != null ? idthematique.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Thematique)) {
            return false;
        }
        Thematique other = (Thematique) object;
        if ((this.idthematique == null && other.idthematique != null) || (this.idthematique != null && !this.idthematique.equals(other.idthematique))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Donnees.Thematique[ idthematique=" + idthematique + " ]";
    }
    
}
